home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / ifl / iflNITF.z / iflNITF
Encoding:
Text File  |  2001-04-17  |  11.8 KB  |  331 lines

  1.  
  2.  
  3.  
  4. iiiiffffllllNNNNIIIITTTTFFFF((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllNNNNIIIITTTTFFFF((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      iiiiffffllllNNNNIIIITTTTFFFF - NITF file format
  10.  
  11. HHHHEEEEAAAADDDDEEEERRRR FFFFIIIILLLLEEEE
  12.      #include <ifl/iflNITF.h>
  13.  
  14.  
  15. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  16.      The Image Format Library (IFL) provides support for reading and writing
  17.      image files with the National Imagery Transmission Format (NITF), Version
  18.      2.0. The format has been designed for transmitting the contents of a
  19.      briefing boards from one location to another.
  20.  
  21.  
  22.      As such, it contains support for storing both imagery and its
  23.      annotations. The IFL interface is used to directly access the imagery
  24.      sections, while the segment interface, described below, is used to access
  25.      the remaining objects contained within the file.
  26.  
  27.  
  28.      The various objects contained within the NITF file are placed into
  29.      segments.  Each segment is divided into two sections, the header section
  30.      and the data section. The header section is a collection fields that
  31.      define how to interpret the data section. The IFL NITF file API provides
  32.      the ability to create, access or modify each of the various segments
  33.      within an NITF file. With the exception of specific header fields, most
  34.      all of the remaining fields are modifiable by the application.
  35.  
  36.  
  37.      A complete listing of all of the available fields within each segment can
  38.      be found in ////uuuussssrrrr////lllliiiibbbb////iiiiffffllll////iiiiffffllll____nnnniiiittttffffffffoooorrrrmmmmaaaatttt.  The field and segment names
  39.      have been chosen to correspond directly to those found in the NITF
  40.      specification.
  41.  
  42.  
  43.      Access to the imagery segments is affected via the standard IFL calls.
  44.      Unlike general NITF file readers, the IFL version requires that the file
  45.      contain at least one image. Each of the images in the NITF file is
  46.      accessed as a separate sub-image, with the first image segment being
  47.      sub-image zero.
  48.  
  49.  
  50.      The remaining segments in the file and the fields of the image segments
  51.      are accessed via the segment interface described below. Using the
  52.      iiiiffffllllFFFFiiiilllleeee::::::::ggggeeeettttTTTTaaaagggg() method, file segments can be retrieved or created.  The
  53.      following are the pseudo ggggeeeettttTTTTaaaagggg() declarations that reflect the segment
  54.      accessors.
  55.  
  56.  
  57.           iflStatus getTag(iflNITFTagId tag, iflNITFSegmentType type,
  58.                            int segNum, iflNITFSegment** seg);
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. iiiiffffllllNNNNIIIITTTTFFFF((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllNNNNIIIITTTTFFFF((((3333))))
  71.  
  72.  
  73.  
  74.      The following calling sequence is used to retrieve an existing segment.
  75.      In this example the retrieved segment is a symbol segment.
  76.  
  77.  
  78.           iflNITFSegment* seg;
  79.           iflStatus sts;
  80.  
  81.           sts = file->getTag(iflNITFTagSegment, iflNITFSegSymbol,
  82.                              0, &seg);
  83.  
  84.  
  85.  
  86.      The following example shows the creation of a new symbol segment. This
  87.      sequence is usable for all but image segments, which must be created
  88.      using the iiiiffffllllFFFFiiiilllleeee::::::::aaaappppppppeeeennnnddddIIIImmmmgggg() or iiiiffffllllFFFFiiiilllleeee::::::::ccccrrrreeeeaaaatttteeee() methods.
  89.  
  90.  
  91.           sts = file->getTag(iflNITFTagNewSegement, iflNITFSegSymbol,
  92.                              1, &seg);
  93.  
  94.  
  95.  
  96.      With a pointer to an iiiiffffllllNNNNIIIITTTTFFFFSSSSeeeeggggmmmmeeeennnntttt, the application can access the
  97.      individual fields of the segment header, and read or write the data
  98.      section of the segment. The following is a list of the iflNITFSegment
  99.      member functions and their descriptions.
  100.  
  101.  
  102.      ggggeeeettttTTTTyyyyppppeeee(((())))
  103.  
  104.           iflNITFSegmentType getType() const
  105.  
  106.  
  107.           Returns this segment's type.
  108.  
  109.  
  110.      ggggeeeettttNNNNuuuummmm(((())))
  111.  
  112.           int getNum() const
  113.  
  114.  
  115.           Returns the index of this segment within the file.
  116.  
  117.  
  118.      ggggeeeettttFFFFiiiieeeelllldddd(((())))
  119.  
  120.           iflNITFFieldPtr getField(const char* name)
  121.  
  122.  
  123.           Retrieve the field associated with _n_a_m_e. If a matching field cannot
  124.           be found then _N_U_L_L is returned.
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. iiiiffffllllNNNNIIIITTTTFFFF((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllNNNNIIIITTTTFFFF((((3333))))
  137.  
  138.  
  139.  
  140.      ggggeeeettttNNNNeeeexxxxttttFFFFiiiieeeelllldddd(((())))
  141.  
  142.           iflNITFFieldPtr getNextField(iflNITFFieldPtr f)
  143.  
  144.  
  145.           Returns the field that immediately follows the field _f. If _f is
  146.           NULL, then the first field of the segment is returned. If _f points
  147.           to the last field in the segment, then NULL is returned.
  148.  
  149.  
  150.      ggggeeeettttFFFFiiiieeeellllddddNNNNaaaammmmeeee(((())))
  151.  
  152.           const char* getFieldName(iflNITFFieldPtr f)
  153.  
  154.  
  155.           Returns the name of field _f.
  156.  
  157.  
  158.      ggggeeeettttFFFFiiiieeeellllddddTTTTyyyyppppeeee(((())))
  159.  
  160.           iflNITFFieldType getFieldType(iflNITFFieldPtr f)
  161.  
  162.  
  163.           Returns the field _f type.
  164.  
  165.  
  166.      ggggeeeettttFFFFiiiieeeellllddddWWWWiiiiddddtttthhhh(((())))
  167.  
  168.           size_t getFieldWidth(iflNITFFieldPtr f)
  169.  
  170.  
  171.           Returns the width of the field _f in bytes as it appears in the NITF
  172.           file.
  173.  
  174.  
  175.      ggggeeeettttFFFFiiiieeeellllddddVVVVaaaalllluuuueeee(((())))
  176.  
  177.           iflStatus getFieldValue(iflNITFFieldPtr f,
  178.                                   int32_t& value)
  179.           iflStatus getFieldValue(iflNITFFieldPtr f,
  180.                                   int64_t& value)
  181.           iflStatus getFieldValue(iflNITFFieldPtr f,
  182.                                   float& value)
  183.           iflStatus getFieldValue(iflNITFFieldPtr f,
  184.                                   const char*& value)
  185.           iflStatus getFieldValue(iflNITFFieldPtr f,
  186.                                   const char*& value, size_t& width)
  187.  
  188.  
  189.           Retrieves the value of the field _f into _v_a_l_u_e. If the type of the
  190.           field does not match the type of _v_a_l_u_e or cannot be promoted, an
  191.           iflBADPARAMS error is returned. The _w_i_d_t_h parameter will contain the
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. iiiiffffllllNNNNIIIITTTTFFFF((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllNNNNIIIITTTTFFFF((((3333))))
  203.  
  204.  
  205.  
  206.           field width for byte or string fields.
  207.  
  208.  
  209.      sssseeeettttFFFFiiiieeeellllddddVVVVaaaalllluuuueeee(((())))
  210.  
  211.           iflStatus setFieldValue(iflNITFFieldPtr f,
  212.                                   int32_t value)
  213.           iflStatus setFieldValue(iflNITFFieldPtr f,
  214.                                   int64_t value)
  215.           iflStatus setFieldValue(iflNITFFieldPtr f,
  216.                                   float value)
  217.           iflStatus setFieldValue(iflNITFFieldPtr f,
  218.                                   const char* value)
  219.           iflStatus setFieldValue(iflNITFFieldPtr f,
  220.                                   const char* value, size_t width)
  221.  
  222.  
  223.           Sets the value of the field _f to _v_a_l_u_e. If the type of the field
  224.           does not match the type of _v_a_l_u_e, or the type of _v_a_l_u_e cannot be
  225.           promoted to the field type, then an iflBADPARAMS error is returned.
  226.           If the field is read-only, then an iflBADFIELDSET error is returned
  227.           to the caller. The _w_i_d_t_h parameter specifies the width of the value
  228.           argument for variable byte length fields. There are currently only
  229.           two such fields in the format, DESDATA and RESDATA. Attempting to
  230.           adjust the width of non-variable length fields will result in an
  231.           iflBADFIELDSET error.
  232.  
  233.  
  234.      ggggeeeettttCCCCoooonnnntttteeeennnnttttLLLLeeeennnnggggtttthhhh(((())))
  235.  
  236.           int64_t getContentLength() const
  237.  
  238.  
  239.           Returns the length of the data section of this segment.
  240.  
  241.  
  242.      rrrreeeeaaaaddddCCCCoooonnnntttteeeennnntttt(((())))
  243.  
  244.           iflStatus readContent(void* buf, size_t bufLen,
  245.                                 size_t& rdLen)
  246.  
  247.  
  248.           This function reads the data section of this segment into buffer
  249.           _b_u_f.  The length of the buffer is given by _b_u_f_L_e_n. The actual number
  250.           of bytes read from the segment is returned in _r_d_L_e_n. Reads of the
  251.           data section always start at the beginning of the data section. That
  252.           is, the entire data section can only be retrieved via a single read.
  253.  
  254.  
  255.      wwwwrrrriiiitttteeeeCCCCoooonnnntttteeeennnntttt(((())))
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. iiiiffffllllNNNNIIIITTTTFFFF((((3333))))        IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll         iiiiffffllllNNNNIIIITTTTFFFF((((3333))))
  269.  
  270.  
  271.  
  272.           iflStatus writeContent(const void* buf, size_t bufLen,
  273.                                  size_t& wrLen)
  274.  
  275.  
  276.           This function writes the data section of this segment from the
  277.           buffer _b_u_f. The amount of data to write from the buffer is given by
  278.           _b_u_f_L_e_n. The actual number of bytes written to the file is returned
  279.           in _w_r_L_e_n. In general, the value returned in _w_r_L_e_n should always
  280.           match _b_u_f_L_e_n.
  281.  
  282.  
  283. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  284.      iflFile, iflFormat
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.